// Copyright (c) 2024-present AI-Labs

// @ ts-nocheck
import { EditorEvents } from "@tiptap/core";
import { UAIEditorEventListener } from "@/interfaces/index.ts";
import { AppPluginMenuButton } from "@/plugins/AppPluginMenuButton.ts";
import { UAIEditorOptions } from "@/types/index.ts";

/**
 * 插件定义
 */
export abstract class AppPlugin extends HTMLElement implements UAIEditorEventListener {
    abstract onCreate(event: EditorEvents['create'], options: UAIEditorOptions): void;
    abstract onTransaction(event: EditorEvents['transaction'], options: UAIEditorOptions): void;
    abstract onEditableChange(editable: boolean): void;

    /**
     * 获取插件名称
     */
    abstract getName(): string;

    /**
     * 获取插件菜单按钮
     * @param type 
     */
    abstract getMenuButton(type: "ribbon" | "classic" | "statusbar"): AppPluginMenuButton | null;

    /**
     * 获取元素
     */
    abstract getContainer(): HTMLElement;
}
